<template>
  <div style="display:flex;flex-direction:column;background-color:white;height:100vh;">
    <div style="display:flex;height:100vh;overflow-y: auto;">
      <van-panel title="我收藏的文章"
                 desc="您收藏的文章将显示在这里">
        <van-list v-model="loading"
                  :finished="finished"
                  finished-text="没有更多了"
                  :error.sync="articleListError"
                  error-text="请求失败,请稍后重试"
                  @load="getCollectionArticleList">
          <div v-for="(item,index) in collectionArticleList"
               v-bind:key="item.id"
               @click="articleInfoHandle(index)"
               style="margin-top:10px;">
            <div style="display:flex;justify-content: space-between;margin-left:10px;margin-right:10px;align-items:flex-start;">
              <div style="height:auto;font-size:10px;margin-right:10px;line-height:1.5em;color:#666">
                <span>{{item.articleTitle}}</span>
              </div>
              <div style="">
                <img :src="item.articleImg"
                     class="img" />
              </div>
            </div>
          </div>

        </van-list>
      </van-panel>
    </div>
    <div v-if="collectionArticleList.length === 0"
         style="display:flex;flex:1;width:100%;flex-direction:column;justify-content:flex-end;">
      <div style="text-align:center;font-size:0.9em;">还没有收藏的文章</div>
      <div style="margin:20px;">
        <van-button type="warning"
                    class="button"
                    size="large"
                    @click="SeeHotArticle">查看热门文章</van-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      collectionArticleList: [{
        articleTitle: '测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题'
      },
      {
        articleTitle: '测试标题测试标题测试标题测试标题测试标题测试标题测试'
      },
      {
        articleTitle: '测试标题测试标题'
      },
      {
        articleTitle: '标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测试标题测'
      }
      ],
      loading: false,
      finished: true,
      articleListError: false
    }
  },
  mounted () {

  },
  methods: {
    getCollectionArticleList () {
      return false
    },
    articleInfoHandle () {

    },
    SeeHotArticle () {

    },
    referencesHandle () {

    },
    pushSettingHandle () {

    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.cellClass {
  margin-top: 10px;
}
.img {
  width: 50px;
  border-radius: 5px;
}
.image {
  width: 50px;
  height: 50px;
}
</style>
